<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div>
    <input type="text" placeholder="员工id" v-model="emp.id">
    <input type="text" placeholder="员工姓名" v-model="emp.name">
    <input type="text" placeholder="员工工资" v-model="emp.salary">
    <input type="text" placeholder="员工工作" v-model="emp.job">
    <input type="submit" value="提交" @click="updateEmp()">
</div>
<!--引入axios和vue框架文件-->
<script src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.min.js"></script>
<script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
<script>
    let v = new Vue({
        el:"body>div",
        data:{
            emp:{
                id:"",name:"",salary: "",job:""
            }
        },
        methods:{
            updateEmp(){
                axios.post("/updateEmp1",v.emp).then(function (response) {
                    alert("更新成功");
                    location.href="/selectEmp1";
                })
            }

        }
    })
</script>
</body>
</html>